﻿@page
@model RazorPages.Pages.ClassPage.IndexModel

@{
    ViewData["Title"] = "Index";
}

<h1>班级列表</h1>

<p>
    <a asp-page="Create">添加班级</a>
</p>
<table class="table">
    <thead class="thead-dark w-100">
        <tr >
            <th>
                @Html.DisplayNameFor(model => model.StudentClass[0].ClassId)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.StudentClass[1].ClassName)
            </th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.StudentClass)
        {
            <tr> 
                <td >
                    @Html.DisplayFor(modelItem => item.ClassId)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.ClassName)
                </td>
                <td>
                    <a class="text-primary" asp-page="./Edit" asp-route-id="@item.ClassId">修改</a> |
                    <a class="text-success" asp-page="./Details" asp-route-id="@item.ClassId">详情</a> |
                    <a class="text-danger" asp-page="./Delete" asp-route-id="@item.ClassId">删除</a>
                </td>
            </tr>
        }
    </tbody>
</table>
